//路由配置
(function() {
var Alarm = APM.Alarm = createApp("alarm");

function heightScroll (){
	setTimeout(function(){
		 $(".application-main").css("overflow-y","scroll");
		 $(".application-main").height($(window).height()-49);
		 $(window).on("resize."+this.elementId, function(){
 			$(".application-main").height($(window).height()-49);		
 		 });
	},10)
}
Alarm.routerMap(function() {
	this.route("alertplatform");
});

APM.AlarmRoute = Alarm.Route.extend({
	templates: [
		{
			name: "main/frame",
			url: "/apps/main/tpls/main_frame.hbs"
		}
	],

	dependences: [
		"/apps/main/ctrls/frame_ctrl",
		"/apps/main/views/frame_view",
	],

	renderTemplate: function(){
		this.render("main/frame", {controller: "mainFrame", view: "mainFrame"});
	}
});

APM.AlarmIndexRoute = Alarm.Route.extend({
	redirect : function() {
		this.transitionTo("alarm.alertplatform");
	}
});

/*---------路由定义----------- */
// 告警台
APM.AlarmAlertplatformRoute = Alarm.Route.extend({
	dependences : [
		"./ctrls/alertplatform_ctrl",
		"./views/alertplatform_view"
	],
	setupController: function(ctrl, params, transition) {
		ctrl.initTime();
		ctrl.keyUpEvent();
		heightScroll();
		ctrl.initConfData();
		// 默认显示新警告
		setTimeout(function(){
			$('.currentAlertStatus .select-content').text("新告警");	
		},0)
		
	},
	actions: {
		willTransition: function(){
			this.controller.send("reset");
		}
	}
});

})();